package com.sky.mapper;

import com.github.pagehelper.Page;
import com.sky.dto.DishPageQueryDTO;
import com.sky.entity.DishFlavor;
import com.sky.vo.DishVO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Classname DishFlavorMapper
 * @Description
 * @Date 2024/2/15 10:25
 * @Created by wangxiaojie
 */
@Mapper
public interface DishFlavorMapper {
    /**
     * 批量添加口味数据
     * @param flavors
     */
    public void insertBath(List<DishFlavor> flavors);

    /**
     * 通过菜品id删除口味数据
     * @param dishId
     */
    @Delete("delete from dish_flavor where dish_id =#{dishId}")
    void deleteByDishId(Long dishId);

    /**
     * 根据菜品id查询口味数据
     * @param dishId
     * @return
     */
    @Select("select * from dish_flavor where dish_id =#{dishId}")
    List<DishFlavor> getByDishId(Long dishId);
}
